/**
 * AWT Sample application
 *
 * @author 
 * @version 1.00 10/10/05
 */
public class QuadraticEquationTester {
    
    public static void main(String[] args) {

		int score = 0;
		
		QuadraticEquation t1 = new QuadraticEquation(1, -5, -6);
		if(t1.hasSolutions())
		{
			score++;
			if(t1.getSolution1() < -.999 && t1.getSolution1() > -1.0001)
				score++;
			else
				System.out.println("Error in test 1");	
			if(t1.getSolution2() > 5.99 && t1.getSolution2() < 6.00001)
				score++;
			else
				System.out.println("Error in test 1");	
		}
		else
			System.out.println("Error in test 1");
			
		QuadraticEquation t2 = new QuadraticEquation(-2, -4, 1);
		if(t2.hasSolutions())
		{
			score++;
			if(t2.getSolution1() > -2.3 && t2.getSolution1() < -2.2)
				score++;
			else
				System.out.println("Error in test 3");	
			if(t2.getSolution2() > .22 && t2.getSolution2() < .23)
				score++;
			else
				System.out.println("Error in test 2");	
		}
		else
			System.out.println("Error in test 2");
		
		QuadraticEquation t3 = new QuadraticEquation(1, -10.5, 3);
		if(t3.hasSolutions())
		{
			score++;
			if(t3.getSolution2() > 10.2 && t3.getSolution2() < 10.21)
				score++;
			else
				System.out.println("Error in test 3");	
			if(t3.getSolution1() > .2938 && t3.getSolution1() < .294)
				score++;
			else
				System.out.println("Error in test 3");	
		}
		else
			System.out.println("Error in test 3");	
		
		QuadraticEquation t4 = new QuadraticEquation(1, 2, 3);
		if(!t4.hasSolutions())
			score++;
		else
			System.out.println("Error in hasSolutions with imaginary solutions");
			
		System.out.println("Your score is: " + score + "/10");
    }
}
